﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ListComment.aspx.cs" Inherits="Manage_Modle_Comment_ListComment" %>
<%@ Register Src="~/Manage/UserControl/PagingCtrl.ascx" TagName="PagingCtrl" TagPrefix="UserControl" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../css/mainFrom.css" rel="stylesheet" type="text/css"/>
    <script language="javascript" src="../../js/common.js" type="text/javascript"></script>
    <script language="javascript">
        //显示层
        function divShow(type)
        {
            document.getElementById("_coverWait").style.display = "block";
            document.getElementById("divChangeFieldInfo").style.display = "block";
            if(type == 1)
            {
                document.getElementById("tbContent").style.display = "block";
                document.getElementById("tbRevert").style.display = "none";
            }
            if(type == 2)
            {
                document.getElementById("tbContent").style.display = "none";
                document.getElementById("tbRevert").style.display = "block";
            }
        }
        
        //隐藏层
        function divHide()
        {
            document.getElementById("_coverWait").style.display = "none";
            document.getElementById("divChangeFieldInfo").style.display = "none";
        }
        
        //取得评论内容
        function getContent(id)
        {
            Manage_Modle_Comment_ListComment.GetContentByID(parseInt(id), refGetContent);
        }
        
        //回调
        function refGetContent(ref)
        {
            divShow(1);
            document.getElementById("txtCommentContent").value = ref.value;
        }
        
        //取得回复
        function getRevert(id)
        {
            document.getElementById("txtCommentID").value = id;
            Manage_Modle_Comment_ListComment.GetRevertByID(parseInt(id), refGetRevert);
        }
        
        //回调
        function refGetRevert(ref)
        {
            divShow(2);
            document.getElementById("txtRevert").value = ref.value;
        }
        
        //提交回复
        function setRevert()
        {
            Manage_Modle_Comment_ListComment.SetRevertByID(parseInt(document.getElementById("txtCommentID").value), document.getElementById("txtRevert").value, refSetRevert);
        }
        
        function refSetRevert(ref)
        {
            if(ref.value == 1)
            {
                alert("回复成功!")
            }
            else
            {
                alert("回复失败!");
            }
            divHide();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="_coverWait" style=" left:0px; top:0px; display:none; Z-INDEX: 999; BACKGROUND: #333333;FILTER: alpha(opacity=30); WIDTH: 100%; POSITION: absolute; HEIGHT:350px;">
    </div>
    <div id="divChangeFieldInfo" align="center" style="z-index:1000; border: 8px solid orange; display:none; background-color:White; position:absolute; left:60px; margin-top:30px;">
        <table border="0" id="tbContent" cellpadding="4" cellspacing="0">
            <tr>
                <td style="height:10px;"><div align="right" style="font-size:14px; cursor:hand;" onclick="divHide();">×</div></td>
            </tr>
            <tr>
                <td><textarea id="txtCommentContent" style="width:300px; height:200px;" rows="8" cols="8"></textarea></td>
            </tr>
            <tr>
                <td style="height:10px;"></td>
            </tr>
        </table>
        <table border="0" id="tbRevert" cellpadding="4" cellspacing="0">
            <tr>
                <td style="height:10px;"><div align="right" style="font-size:14px; cursor:hand;" onclick="divHide();">×</div></td>
            </tr>
            <tr>
                <td><textarea id="txtRevert" style="width:300px; height:200px;" rows="8" cols="8"></textarea><input id="txtCommentID" type="hidden" /></td>
            </tr>
            <tr>
                <td align="center">
                    <input type="button" value="回复" onclick="setRevert();" style="CURSOR: hand"/>
                </td>
            </tr>
            <tr>
                <td style="height:10px;"></td>
            </tr>
        </table>
    </div>
    <div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="content-table">
        <tr onmouseover="setbg2(this)" onmouseout="setbg1(this)">
            <th class="thcenter" style="width:40px;">
                ID
            </th>
            <th class="thleft" style="width:315px;">
                标题
            </th>
            <th class="thcenter none" style="width:220px;">
                操作
            </th>
        </tr>
        <asp:Repeater ID="repIntor" runat="server" OnItemCommand="repnew_ItemCommand"  OnItemDataBound="repnew_ItemDataBound">
          <ItemTemplate>
                <tr style="background: #F2F2F2;" onmouseover="setbg2(this)" onmouseout="setbg1(this)">
                    <td class="thcenterpad0" align="center">
                        <asp:HiddenField ID="hidID" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>' />
                        <input type="checkbox" id="ID" name="ID" value='<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>'/>
                    </td>
                    <td><asp:Literal Text='<%# GetStrLeng(DataBinder.Eval(Container.DataItem, "Comment_Title").ToString())%>' runat="server" ID="Literal1" /></td>
                    <td class="thcenterpad0">
                        <input type="button" value="查看内容" style="CURSOR: hand" onclick='getContent(<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>);' />
                        <input type="button" value="回复" style="CURSOR: hand"  onclick='getRevert(<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>);' />
                        <img src="../../images/edit2.gif" width="16" height="16" style="CURSOR: hand" alt="编辑" onclick="parent.location.href = 'EditProduct.aspx?CatID=<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>&NewsID=<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>&action=editProducts';"/>
                    &nbsp;
                    <asp:LinkButton Text='<img src="../../images/ico_del.gif" width="16" height="16" style="CURSOR: hand" alt="删除"/>' runat="server" ID="HypDelete" CommandName="delete" />
                    </td>
                </tr>
          </ItemTemplate>
          <AlternatingItemTemplate>
            <tr onmouseover="setbg2(this)" onmouseout="setbg1(this)">
                <td class="thcenterpad0" align="center">
                    <asp:HiddenField ID="hidID" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>' />
                    <input type="checkbox" id="ID" name="ID" value='<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>'/>
                </td>
                <td><asp:Literal Text='<%#  GetStrLeng(DataBinder.Eval(Container.DataItem, "Comment_Title").ToString())%>' runat="server" ID="Literal1" /></td>
                <td class="thcenterpad0">
                    <input type="button" value="查看内容" style="CURSOR: hand" onclick='getContent(<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>);' />
                    <input type="button" value="回复" style="CURSOR: hand" onclick='getRevert(<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>);' />
                    <img src="../../images/edit2.gif" width="16" height="16" style="CURSOR: hand" alt="编辑" onclick="parent.location.href = 'EditProduct.aspx?CatID=<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>&NewsID=<%# DataBinder.Eval(Container.DataItem, "Comment_ID")%>&action=editProducts';"/>
                    &nbsp;
                    <asp:LinkButton Text='<img src="../../images/ico_del.gif" width="16" height="16" style="CURSOR: hand" alt="删除"/>' runat="server" ID="HypDelete" CommandName="delete" />
                </td>
            </tr>          
          </AlternatingItemTemplate>
        </asp:Repeater>
    </table> 
    </div>
    <asp:HiddenField ID="hidAmount" runat="server" />
    <asp:HiddenField ID="hidSql" runat="server" />
    <div class="allopStyle">
         &nbsp;&nbsp;选择: <a href="javascript:void(0);" onclick="QuanXuan_Click()">全选</a> - <a href="javascript:void(0);" onclick="slcNo_click()">反选</a> - <a href="javascript:void(0);" onclick="QuXiao_Click()">不选</a>
         <asp:Button ID="btnDelete" runat="server" Text=" 批量删除 " CssClass="button" OnClientClick="return confirm('请慎用批量删除!')" OnClick="btnDelete_Click"/>
    </div>
    <div id="PanPage" class="pageStyle">
              <UserControl:PagingCtrl ID="pagingctrl" OnPageIndexChanged="BindRpt" runat="server" PageRange="10" />
    </div>
    </form>
</body>
</html>